******************************************************************************************************************************************
*MANUSCRIPT: Authorized Generic Entry prior to Patent Expiry: Reassessing Incentives for Independent Generic Entry 
*AUTHOR:     Silvia Appelt, University of Munich, silvia.appelt@lrz.uni-muenchen.de

******************************************************************************************************************************************
				        *** Extraction NPI data tables from SQL database: NPI DB05 (1999-2001/2002-2005) ***
						            		* Date last edit:  11 January 2015 * 
******************************************************************************************************************************************   
version 13.0
set more off
cap log close
clear
 
/*
For data inquiries, including database software, username and password, please contact:
INSIGHT Health GmbH & Co. KG
Auf der Lind 10
65529 Waldems-Esch
Tel.: 06126/955-0
Fax: 06126/955-20
E-Mail: info@insight-health.de
http://www.insight-health.de/ 
*/

odbc list
odbc query "NPI90DI", user(XXX) password(XXX)

odbc load,  table(abg) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table abg (DB05)"
save abg_db05.dta, replace
clear

odbc load,  table(ais) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table ais (DB05)"
save ais_db05.dta, replace
clear

odbc load,  table(atc1) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc1 (DB05)"
save atc1_db05.dta, replace
clear

odbc load,  table(atc2) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc2 (DB05)"
save atc2_db05.dta, replace
clear

odbc load,  table(atc3) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc3 (DB05)"
save atc3_db05.dta, replace
clear

odbc load,  table(atc4) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table atc4 (DB05)"
save atc4_db05.dta, replace
clear

odbc load,  table(DI_CODES) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_CODES (DB05)"
save DI_CODES_db05.dta, replace
clear

odbc load,  table(DI_COLUMNS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_COLUMNS (DB05)"
save DI_COLUMNS_db05.dta, replace
clear


odbc load,  table(DI_COMB_BASE) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_COMB_BASE (DB05)"
save DI_COMB_BASE_db05.dta, replace
clear


odbc load,  table(DI_COMB_ELEMS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_COMB_ELEMS (DB05)"
save DI_COMB_ELEMS_db05.dta, replace
clear

odbc load,  table(DI_FACTS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_FACTS (DB05)"
save DI_FACTS_db05.dta, replace
clear

odbc load,  table(DI_FUNCTIONS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_FUNCTIONS (DB05)"
save DI_FUNCTIONS_db05.dta, replace
clear


odbc load,  table(DI_GROUPS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_GROUPS (DB05)"
save DI_GROUPS_db05.dta, replace
clear


odbc load,  table(DI_GRP_BASE) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_GRP_BASE (DB05)"
save DI_GRP_BASE_db05.dta, replace
clear


odbc load,  table(DI_GRP_ELEMS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_GRP_ELEMS (DB05)"
save DI_GRP_ELEMS_db05.dta, replace
clear

odbc load,  table(DI_JOINS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_JOINS (DB05)"
save DI_JOINS_db05.dta, replace
clear


odbc load,  table(DI_ONE) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_ONE (DB05)"
save DI_ONE_db05.dta, replace
clear


odbc load,  table(DI_QDEF_TOPICS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_QDEF_TOPICS (DB05)"
save DI_QDEF_TOPICS_db05.dta, replace
clear

odbc load,  table(DI_TOPICS) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table DI_TOPICS (DB05)"
save DI_TOPICS_db05.dta, replace
clear

odbc load,  table(einf) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table einf(DB05)"
save einf_db05.dta, replace
clear


odbc load,  table(fbetrag) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table fbetrag (DB05)"
save fbetrag_db05.dta, replace
clear

odbc load,  table(gen) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table gen(DB05)"
save gen_db05.dta, replace
clear

odbc load,  table(hafo) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table hafo (DB05)"
save hafo_db05.dta, replace
clear

odbc load,  table(hst) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table hst(DB05)"
save hst_db05.dta, replace
clear

odbc load,  table(hst_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table hst_hist (DB05)"
save hst_hist_db05.dta, replace
clear

odbc load,  table(jahr) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table jahr(DB05)"
save jahr_db05.dta, replace
clear

odbc load,  table(jahr_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table jahr_hist (DB05)"
save jahr_hist_db05.dta, replace
clear

odbc load,  table(konz) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table konz (DB05)"
save konz_db05.dta, replace
clear

odbc load,  table(mat) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table mat (DB05)"
save mat_db05.dta, replace
clear

odbc load,  table(monat) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table monat (DB05)"
save monat_db05.dta, replace
clear

odbc load,  table(nfc1) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nfc1 (DB05)"
save nfc1_db05.dta, replace
clear


odbc load,  table(nfc2) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nfc2 (DB05)"
save nfc2_db05.dta, replace
clear


odbc load,  table(nfc3) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nfc3 (DB05)"
save nfc3_db05.dta, replace
clear

odbc load,  table(nnn) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table nnn (DB05)"
save nnn_db05.dta, replace
clear

odbc load,  table(npi) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table npi (DB05)"
save npi_db05.dta, replace
clear

odbc load,  table(pck) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table pck (DB05)"
save pck_db05.dta, replace
clear

odbc load,  table(prd) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table prd (DB05)"
save prd_db05.dta, replace
clear

odbc load,  table(prdo) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table prdo (DB05)"
save prdo_db05.dta, replace
clear

odbc load,  table(pzn) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table pzn (DB05)"
save pzn_db05.dta, replace
clear

odbc load,  table(quartal) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table quartal (DB05)"
save quartal_db05.dta, replace
clear

odbc load,  table(str) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table str (DB05)"
save str_db05.dta, replace
clear

odbc load,  table(sub) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table sub (DB05)"
save sub_db05.dta, replace
clear

odbc load,  table(val) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table val (DB05)"
save val_db05.dta, replace
clear

odbc load,  table(val_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table val_hist (DB05)"
save val_hist_db05.dta, replace
clear

odbc load,  table(val_hst_hist) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table val_hst_hist (DB05)"
save val_hst_hist_db05.dta, replace
clear

odbc load,  table(ytd) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table ytd (DB05)"
save ytd_db05.dta, replace
clear

odbc load,  table(zklass) user(XXX) password(XXX) dsn(NPI90DI)
label data "NPI90DI: table zklass (DB05)"
save zklass_db05.dta, replace
clear


*** end of do file




